<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>结构伪类</title>
    <style type="text/css">
        .outer {
            width: 80%;
            border: 1px solid gray;
            margin: 25px auto;
        }
        
        .outer>* {
            height: 20px;
            border: 1px solid blue;
            margin: 15px;
        }
        
        .outer div:first-of-type {
            background: #dedede;
        }
        
        .outer div:last-of-type {
            background: #ffff00;
        }
        
        .outer p:first-of-type {
            background: #9696ff;
        }
        
        .outer p:last-of-type {
            background: #f88e2a;
        }
        
        .outer :first-of-type {
            text-align: center;
            color: red;
        }
        
        .outer :last-of-type {
            text-align: center;
            color: green;
        }
    </style>
</head>

<body>

    <div class="outer">
        <div>甲子</div>
        <p>第1个段落</p>
        <div></div>
        <p>第2个段落</p>
        <div></div>
        <p>第3个段落</p>
        <div></div>
        <p>第4个段落</p>
        <div></div>
        <p>第5个段落</p>
        <div>辛丑</div>
        <p>第6个段落</p>
    </div>

</body>

</html>